package com.zpark.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @Author: Abigale
 * @Date: 2022/9/20 10:55
 * @Version: 1.0
 */
@RestController // 以JSON格式返回
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/login.do") // 路径要和config里的对应
    public String login(HttpSession session){
        // 往Session对象中绑定数据，从方法参数位置拿一个session对象
        session.setAttribute("User", "code:200");

        return "登陆成功";
    }
}
